﻿<UserControl x:Class="ETRobocon.RaceTraking.GamePresentation.RunnerTimerCounterUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:src="clr-namespace:ETRobocon.RaceTraking.GamePresentation"
    Height="60" Width="215">
		
    <UserControl.Resources>
    	<ResourceDictionary>
    		<ResourceDictionary.MergedDictionaries>
    			<ResourceDictionary Source="Styles/ResourceDictionary.xaml"/>
    		</ResourceDictionary.MergedDictionaries>
    	
	        <Style TargetType="TextBlock">
	            <Setter Property="FontSize" Value="48"/>
	            <Setter Property="VerticalAlignment" Value="Center"/>
	            <Setter Property="HorizontalAlignment" Value="Center"/>
	            <Setter Property="Foreground" Value="Gold"/>
	            
	        </Style>
	        <src:InternalRunnerStopWatch x:Key="stopWatch"/>
			<src:TimeCountFaceInfo x:Key="FaceInfo"/>
			
			
	        <Storyboard x:Key="BlinkStoryboard" >
	            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="borderBG" Storyboard.TargetProperty="Opacity" BeginTime="0:0:15" >
	                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:0"/>
	                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:1"/>
	                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:2"/>
	                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:3"/>
	                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:4"/>
	                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:5"/>
	                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:5.75"/>
	                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:6.5"/>
	                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:7.25"/>
	                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:8"/>
	                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:8.75"/>
	                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:9.5"/>
	                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:10.25"/>
	                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:11"/>
	                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:11.5"/>
	                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:12"/>
	                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:12.5"/>
	                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:13"/>
	                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:13.5"/>
	                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:14"/>
	                <LinearDoubleKeyFrame Value="0" KeyTime="0:0:14.5"/>
	                <LinearDoubleKeyFrame Value="1" KeyTime="0:0:15"/>
	            </DoubleAnimationUsingKeyFrames>
	            <ColorAnimationUsingKeyFrames Storyboard.TargetName="alertBlush" Storyboard.TargetProperty="Color">
	                <LinearColorKeyFrame Value="Red" KeyTime="0:0:15"/>
	            </ColorAnimationUsingKeyFrames>
	        </Storyboard>
			
        
		</ResourceDictionary>
    </UserControl.Resources>
    
    <Grid Background="{DynamicResource NumberBoxSmallNormal}">
		<Border x:Name="borderBG"
			Margin="3,3,3,3" Width="294" Height="74" 
			HorizontalAlignment="Center" VerticalAlignment="Center"
			CornerRadius="15,15,15,15" BorderThickness="0" Visibility="Collapsed">
            
			<Border.Background>
				<SolidColorBrush x:Name="alertBlush" Color="{Binding Brush, Source={StaticResource FaceInfo}}"/>
			</Border.Background>
		</Border>
		
		<Grid Margin="6,8,6,0" DataContext="{Binding Source={StaticResource stopWatch}}">
    		<Grid.ColumnDefinitions>
    			<ColumnDefinition Width="*"/>
    			<ColumnDefinition Width="*"/>
    			<ColumnDefinition Width="20"/>
    			<ColumnDefinition Width="*"/>
    			<ColumnDefinition Width="*"/>
    			<ColumnDefinition Width="20"/>
    			<ColumnDefinition Width="*"/>
    		</Grid.ColumnDefinitions>
    		<TextBlock x:Name="textBoxMH" Grid.Column="0" Text="{Binding MinH}" FontWeight="Bold" Foreground="{DynamicResource FontColorBrush04}"/>
    		<TextBlock x:Name="textBoxML" Grid.Column="1" Text="{Binding MinL}" FontWeight="Bold" Foreground="{DynamicResource FontColorBrush04}"/>
    		<TextBlock x:Name="textBoxSH" Grid.Column="2" Text=":" FontWeight="Bold" Foreground="{DynamicResource FontColorBrush04}"/>
    		<TextBlock x:Name="textBoxSL" Grid.Column="3" Text="{Binding SecH}" FontWeight="Bold" Foreground="{DynamicResource FontColorBrush04}" />
    		<TextBlock x:Name="textBoxSD" Grid.Column="4" Text="{Binding SecL}" FontWeight="Bold" Foreground="{DynamicResource FontColorBrush04}" />
    		<TextBlock Grid.Column="5" Text="." FontWeight="Bold" Foreground="{DynamicResource FontColorBrush04}" />
    		<TextBlock Grid.Column="6" Text="{Binding SecD}" FontWeight="Bold" Foreground="{DynamicResource FontColorBrush04}" />
    	</Grid>
	</Grid>
</UserControl>
